package plantsVSzombies;

public abstract class Plants {

	public abstract int getHp();

	public abstract void setHp(int hp);

	public abstract String getName();

	public abstract int getAtk();

	public abstract void setAtk(int atk);
	
	public Plants() {
		System.out.println("===============================");
		System.out.print("植物方派出了"+this.getName()+" ");
	}

	public void attackZombies(Zombies p) {
		System.out.print(this.getName()+"对僵尸  " + p.getName() + " 造成了 " + this.getAtk() + " 点伤害");
		p.setHp(p.getHp() - this.getAtk());
		if (p.getHp() > 0) {
			System.out.println("    僵尸还有血量: " + p.getHp());
		}
		else {
			System.out.println("    僵尸 "+p.getName()+"已死亡");
		}
	}
	
}
